package com.example.demo.role.service.serviceIml;

import com.example.demo.role.dao.RoleDao;
import com.example.demo.role.entity.Role;
import com.example.demo.role.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceIml implements RoleService {

    @Autowired
    private RoleDao roleDao;

    /**
     * 添加角色
     * @param role
     * @return
     */
    @Override
    public int addRole(Role role) {
        return roleDao.addRole(role);
    }

    /**
     * 删除角色
     * @param id
     * @return
     */
    @Override
    public int deleteRole(int id) {
        return roleDao.deleteRole(id);
    }

    /**
     * 更新角色
     * @param role
     * @return
     */
    @Override
    public int updateRole(Role role) {
        return roleDao.updateRole(role);
    }

    /**
     * 查询全部角色
     * @return
     */
    @Override
    public List<Role> selectAllRole() {
        return roleDao.selectAllRole();
    }
}
